import React from 'react';
import './style/wodezhangdan.css';

const tabData = [
    { title: '全部', key: 0 },
    { title: '收入', key: 1 },
    { title: '支出', key: 2 },

];

class WoDeZhangDan extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            tabIndex: 0
        }
    }

    selectTab = (v) => {
        this.setState({
            tabIndex: v
        })
    }

    render() {
        return (
            <div className='wodezhangdan'>
                <div className='wodezhangdanNavbar'>
                    <img className='wodezhangdanNavbarArrow' alt='' src={require('./img/chongzhi/left.png')} />
                    <div className='wodezhangdanNavbarTitle'>
                        {
                            tabData && tabData.map((v, k) => {
                                let select = '';
                                if (this.state.tabIndex === v.key) {
                                    select = 'select';
                                }
                                return <span className={`${select}wodezhangdanNavbarTitleItem`} onClick={() => this.selectTab(v.key)} key={v + k}>{v.title}</span>
                            })
                        }
                    </div>
                </div>
                <div className='wodezhangdanScroll'>
                   
                </div>
            </div>)
    }

}

export default WoDeZhangDan;
